﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;


namespace GCGGeneralLib
{
    public class DataBaseConnection
    {

        public static Boolean DbTestConnection(String connection)
        { 
           MySqlConnection conn = new MySqlConnection(connection);
           try
           {
               conn.Open();
               conn.Close();
               return true;
           }
           catch (MySqlException)
           {
               return false;
           }
            
        }

        public static MySqlConnection DbConnection()
        {
        	MySqlConnection conn = new MySqlConnection(GCGGeneralLib.GeneralVar.FullConnectionString);
        	
            return conn;
        }
    }
}
